package model

import (
	errno "entrytask/pkg/error"
	"errors"
)

// User 用户信息
type User struct {
	Username string `json:"username"`
	Nickname string	`json:"nickname"`
	Password string	`json:"password"`
	Profile string	`json:"profile"`
}

// UserLogin 用户登陆信息
type UserLogin struct {
	Username string `json:"username"`
	Password string	`json:"password"`
}

// Validate the fields.
func (user *User) Validate() error {
	if user.Username == "" || user.Password == "" {
		return errors.New(errno.ErrValidation.Message)
	}
	return nil
}